import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
import { Storage } from '@ionic/storage';
import { LoginPage } from '../../pages/login/login';
import { User } from '../../providers/login-data/user';
import { UserSettingProvider } from '../../providers/user-setting/user-setting';
import { Observable } from 'rxjs/Observable';


// declare var AMap:any;

@Component({
  selector: 'page-person-detail',
  templateUrl: 'person-detail.html',

})
export class PersonDetailPage {
  
 
  user: User[] = [];
  data  = new Array();

//  val :Array<string>;
//  arr = new Array();
   val:any;
  constructor(public navCtrl: NavController,
    public navParams: NavParams,
    public userSetting: UserSettingProvider,
    storage: Storage,
  ) {
    // storage.get('USER_INFO').then((value) => {
    //   this.val =  JSON.parse(value);
    //   // alert(this.val.objectid);
    // });
     
     }
     
    
  ionViewDidEnter() {

    this.data[0] = localStorage.getItem('username');
    this.data[1] = localStorage.getItem('objectId');
    this.data[2] = localStorage.getItem('name');
    this.data[3] = localStorage.getItem('leval');
    this.data[4] = localStorage.getItem('sex');
    this.data[5] = localStorage.getItem('mobilePhoneNumber');
    this.data[6] = localStorage.getItem('belong');
    this.data[7] = localStorage.getItem('position');
    console.log(this.data);
    
  // this.userSetting.getUsers().subscribe(user=>{
  //   this.user=user;
  //   console.log(this.user);
  //  } );
   
   
    
    
  }

}
